home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
MYMUD21.ZIP
/
MMUD21.ZIP
/
SOURCE
/
11_STUFF.ZIP
/
ML_IO.ZIP
/
MYIO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-07-05
|
2KB
|
136 lines
Unit MYIO;
interface
Uses CRT,
Dos,
Foreign,
VGAFont,
Header;
Procedure My_ReadLn(Var S : String);
Function My_KeyPressed:Boolean;
Function My_ReadKey:Char;
Procedure My_Write(S : String);
Procedure My_WriteLn(S : String);
Procedure My_ClrEol;
Procedure My_Delay(D : LongInt);
Procedure My_ClrScr;
Implementation
Function ScrollLock:Boolean;
Begin
ScrollLock:=(Mem[0:$417] and $10)=$10;
End;
Procedure My_ReadLn(Var S : String);
Var Stop : Boolean;
Key : Char;
Begin
S:='';
Stop:=False;
Repeat
Key:=My_ReadKey;
Case Key Of
#00 : Key:=My_ReadKey;
#27 : Begin
While S<>'' Do
Begin
My_Write(#8' '#8);
Dec(S[0]);
End;
End;
#13 : Stop:=True;
#8 : begin
If S<>''
then Begin
Dec(S[0]);
My_Write(#8' '#8);
End;
End;
Else Begin
S:=S+Key;
My_Write(Key);
End;
End; {Case}
Until Stop;
My_WriteLn('');
End;
Function My_KeyPressed:Boolean;
Begin
My_KeyPressed:=CRT.KeyPressed;
End;
Function My_ReadKey:Char;
Var Key : Char;
Begin
Key:=CRT.ReadKey;
If ScrollLock
Then ForeignKeys(Key);
My_ReadKey:=Key;
End;
Procedure My_Write(S : String);
Begin
Write(S);
End;
Procedure My_WriteLn(S : String);
Begin
WriteLn(S);
End;
Procedure My_ClrEol;
Begin
CRT.ClrEol;
End;
Procedure My_ClrScr;
Begin
CRT.ClrScr;
End;
Procedure My_Delay(D : LongInt);
Begin
CRT.Delay(D);
End;
(*--------------------------------------------------------------------------*)
Function ExistFile(FilePath : ComStr):Boolean;
Var Zoek: SearchRec;
Begin
FindFirst(FilePath,AnyFile,Zoek);
ExistFile:=(DosError=0);
End;
Var SupportFileName : ComStr;
ExitSave : Pointer;
{$F+}
Procedure MyExit;
{$F-}
Begin
If IsVGAorEGA
Then ResetVGAFont;
ExitProc:=ExitSave;
End;
Begin
ExitSave:=ExitProc;
ExitProc:=@MyEXIT;
SupportFileName:=HomeDir+'MyMUD';
If ExistFile(SupportFileName+'.LKY') And
ReadDefinition(SupportFileName+'.LKY')
Then UseForeign:=True;
If ExistFile(SupportFileName+'.FNT') And
IsVGAorEGA And
LoadVGAFont(supportFileName+'.FNT')
Then;
End.